javax.realtime.DSS
Class PreemptableResource
java.lang.Object
javax.realtime.DSS.Resource
javax.realtime.DSS.PreemptableResource
- public class PreemptableResource
- extends Resource
A Resource
modeling a resource that can be
preempted.
Methods inherited from class javax.realtime.DSS.Resource |
dutyCycle, finalize, getExtent, giveResourceTo, maxWaiterPriority, printAllStatistics, printStatistics, releaseIfHeld, seize, seizeIfNotHeld, setExtent, toString, waiterIterator |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PreemptableResource
public PreemptableResource(java.lang.String name,
boolean signalPriorityInversion)
- Constructor
- Parameters:
name
- The name of this
PreemptableResource
public PreemptableResource(java.lang.String name)
seize
public void seize()
throws java.lang.InterruptedException,
ThreadTerminatedException
- Seize this
Preemptableresource
.
An internal loop
is required to deal with the case where the resource was stolen between the time
it was awarded by a releasing thread and the invoking thread starts to run.
- Specified by:
seize
in class Resource
- Throws:
java.lang.InterruptedException
ThreadTerminatedException
release
public void release()
throws ThreadTerminatedException
- Release this
PreemptableResource
.
May involve passing it on to a waiting thread.
- Specified by:
release
in class Resource
- Throws:
ThreadTerminatedException
adjustPriority
public void adjustPriority(RealtimeThread thread)
- Description copied from class:
Resource
- Adjust the priority of this
RealtimeThread
, according to resources currently held.
- Specified by:
adjustPriority
in class Resource